<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.SmsModule.dao.*"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="3" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="um" value="12" /></jsp:include> 
<form action="" id="frmMessage" name="frmMessage"></form>
    <section id="container">
    <%
    //---------分页
    int currentPage=1;
    if(request.getParameter("Page")!=null)
    {
    	currentPage=Integer.parseInt(request.getParameter("Page"));
    }
    if(session.getAttribute("userModuleResult")!=null){
    out.println("<script>alert('"+session.getAttribute("userModuleResult").toString()+"');</script>");
    session.removeAttribute("userModuleResult");
    }
    if(request.getParameter("del")!=null)
    {
        if(new TbUserDAO().del(Integer.parseInt(request.getParameter("del")))){
        out.println("<script>alert('删除用户成功');</script>");
        }else{
        out.println("<script>alert('删除用户失败');</script>");	
        }
    }	
    %>
    <div id="crumbs">
        	账户管理 &raquo; 用户列表
    </div>
        <div id="main">
        	<div class="tabs">
                <ul class="tabs-nav clearfix">
                    <li>用户列表</li>
                </ul>
                <div class="tabs-panel">
<%
	            int colSpanNum=11;
%>
                	<table width="100%" class="datalist">
                    	<thead>
                    	    <tr><td class="tc"><input type="button" value="添加用户" onclick="$mb=$.msgbox({
                    	        height:350,
                    	        width:450,
                    	        content:{type:'url',content:'UserModule/UserOperate.jsp'},
                    	        title: '添加用户'
                    	    });"/></td><td colspan="4"></td></tr>
                        	<tr>
                            	<!-- <td class="tc">
                            	    <input type="checkbox" name="ckUsers" id="ckUsers" onClick="selectAll('ckUsers');"  />
                            	</td> -->
                            	<td class="tc">用户名</td>
                            	<td class="tc">标识码</td>
                            	<!-- <td class="tc">用户类型</td>
                            	<td class="tc">手机号码</td>
                            	<td class="tc">出生日期</td> -->
                            	<td class="tc">创建时间</td>
                            	<td class="tc">编辑</td>
                            	<td class="tc">删除</td>
                            </tr>
                        </thead>
                       <%
                       List<TbUserBean> userList=new TbUserDAO().getAllTbUsers();
                       if(userList!=null){
                        for(TbUserBean userBean:userList){
                        	%>
                        	<tr>
                        	<td class="tc">
                        	 <%=userBean.getUserName() %>
                        	</td>
                        	<td class="tc">
                        	 <%=userBean.getOrgNum() %>
                        	</td>
                        	<td class="tc">
                        	 <%=userBean.getCreateTime()%>
                        	</td>
                        	<td class="tc"> 
                              <a href="javascript:void(0);" class="duanyu_edit" onclick="$mb=$.msgbox({
                    	        height:350,
                    	        width:450,
                    	        content:{type:'ajax',content:'UserModule/UserOperate.jsp?id=<%=userBean.getUserId() %>'},
                    	        title: '修改用户'
                    	    });">修改</a>
                                </td>
                                <td class="tc"> 
                                <a href="javascript:void(0);" onclick="if(confirm('确定要删除吗?'))window.location='UsersList.jsp?del=<%=userBean.getUserId() %>';" class="duanyu_del">删除</a>
                                </td>
                        	</tr>
                        	<% 
                        }
                       }
                       %>
                    </table>
                </div>      
        	</div>
        </div>
  </section>
  <jsp:include page="../foot.jsp"></jsp:include>
  </div>
</body>
</html>
